/*
 * Copyright (c) 2006 Mikhail V. Denisenko.
 * All rights reserved.
 *
 * Module for representing Polygon data in memory.
 *
 * $Id$
 */

#ifndef PolygonH
#define PolygonH


#include "types.hpp"


class Triangle;


class Polygon
{
private:
	std::vector<Vector3> _dots;
	std::vector<Vector3> _normals;
	std::vector<TexCoords> _texCoords;
	// colors?

public:
	std::vector<Triangle*> Triangulate();
	void Transform(const Matrix4 & matrix);

friend class PolygonBuilder;
};


class PolygonBuilder
{
public:
	void Begin();
	void AddPoint(const Vector3& coord, const Vector3& normal,
		const TexCoords& tex);
	Polygon * Grab();

private:
	std::auto_ptr<Polygon> _polygon;
};


#endif // PolygonH
